import uviewPlus from '@/uni_modules/uview-plus'

import {
	createSSRApp
} from "vue";
import App from "./App.vue";

//引入pinia
import store from '@/store';
import {
	createPinia
} from 'pinia';
import {
	createPersistedState
} from 'pinia-plugin-persistedstate';

//引入插件
// import pageJump from '@/plugins/pageJump';
import '@/utils/pageJump';

export function createApp() {
	const app = createSSRApp(App);

	app.use(uviewPlus)

	const pinia = createPinia();
	pinia.use(
		createPersistedState({
			storage: localStorage,
			auto: true, // 启用所有Store默认持久化
		})
	);
	app.use(pinia);
	// app.config.globalProperties.$store = store;
	app.provide('$store',store);
	
	app.config.globalProperties.$myGlobalMethod = () => {
	  console.log('这是我的全局方法');
	};
	
	// app.use(pageJump)

	return {
		app,
	};
}